import random
import misc
import board
import movegenerator
import copy
import rules


print "white is -1, black is 1"
print "you are black"
play = True
goboard = board.board(19)
while play:
	validmove = False

	while (not validmove):
		print "please enter a valid move"
		x = eval(raw_input("your x: "))
		y = eval(raw_input("your y: "))
		if rules.islegal(1, [x,y], goboard):
			goboard = rules.newboardstate(1,[x,y],goboard)
			print goboard
			validmove=True

	validmove = False
		
	while (not validmove):
	        compmove = movegenerator.randmove()
		x = compmove[0]
		y = compmove[1]
		if rules.islegal(-1,[x,y],goboard):
			goboard = rules.newboardstate(-1,[x,y],goboard)
			print goboard
			validmove=True


